package com.bishe.demo.modules.other.dao;

import com.bishe.demo.modules.other.entity.SceneryTravel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface SceneryTravelDao {
    @Insert("insert into other_scenery_travel values(null,#{sceneryId},#{travelId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertSceneryTravel(SceneryTravel sceneryTravel);

    @Delete("delete from other_scenery_travel where scenery_id=#{sceneryId}")
    void deleteSceneryTravelBySceneryId(int sceneryId);

    @Delete("delete from other_scenery_travel where travel_id=#{travelId}")
    void deleteSceneryTravelByTravelId(int travelId);
}
